function search() {//搜索框
	var value1= $("#searchName").val();//取值
	//alert(value1);
	newItems = $("#new_items_form");
	//alert(name+'1');
	newItems.empty();
	$.ajax({
		type:"post",
		url:"itemTableAction!FindByKeyword",
		data:{"keyword":value1},
		dataType:"json",
		success:function(result){
			//alert(result);
		    if(result == ""){
		    	newItems.empty();
		    	newItems.append('<p>无任何信息/p>');
			}else{
				if(result.code == "001"){
					alert("请先登录");
					window.location.href = 'index.jsp';
				}
				if(result.code == "002"){
					
					alert("网站正在维护中，请稍后登录");
					window.location.href = 'index.jsp';
				}
				//alert("2222222222");			
				e='<h4 align="center">找到以下所有与“'+value1+'”相关的物品</h4>';
				var result1 = result.items;
				$.each(result1,function(){
					
				e +='<div class="item_newItem2">'+
					'<img src="' + this.picture + '"style="margin-left:22%"></img>'+
					'<div>'+
						'<table class="table">'+
							'<tbody align="center">'+
								'<tr>'+
									'<td>名称</td>'+
									'<td>'+this.itemName+'</td>'+
								'</tr>'+
								'<tr>'+
									'<td>价格</td>'+
									'<td>'+this.itemPrice+'</td>'+
								'</tr>'+
								'<tr>'+
									'<td>余量</td>'+
									'<td>'+this.itemNumber+'</td>'+
								'</tr>'+
							'</tbody>'+
						'</table>'+
					'</div>'+
					'<button class="btn btn-primary" style="margin-left: 37%;" onclick="showItem_detail('+this.itemId+');">详情</button>&nbsp;&nbsp;'+		
				'</div>';
				});

				e+='<div class="pagination" style="margin-left: 25%">'+
				'<ul>'+
					'<li class="previous"><a href="itemShow.jsp"><img src="image/previous.png" /> </a></li>'+
					'<li><a href="itemShow.jsp">1</a></li>'+
					'<li><a href="itemShow.jsp">2</a></li>'+
					'<li><a href="itemShow.jsp">3</a></li>'+
					'<li><a href="itemShow.jsp">4</a></li>'+
					'<li><a href="itemShow.jsp">5</a></li>'+
					'<li><a href="itemShow.jsp">6</a></li>'+
					'<li><a href="itemShow.jsp">7</a></li>'+
					'<li><a href="itemShow.jsp">8</a></li>'+
					'<li><a href="itemShow.jsp">9</a></li>'+
					'<li class="next"><a href="itemShow.jsp"><img src="image/next.png" /> </a></li>'+
				'</ul>'+
			'</div>';
			
				newItems.append(e);		
				
			}
			//重新渲染

		},
		error:function(err){
					
			alert(err.message);
		}
	});
}